package zack.project.domain.award.model.aggregate;

import zack.project.domain.award.model.entity.UserAwardRecordEntity;
import zack.project.domain.award.model.entity.UserCreditAwardEntity;
import zack.project.domain.award.model.valobj.AwardStateVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author A1793
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GiveOutPrizesAggregate {

    private String userId;

    private UserAwardRecordEntity userAwardRecord;

    private UserCreditAwardEntity userCreditAwardEntity;

    public static UserAwardRecordEntity buildUserAwardRecordEntity(String userId, String orderId, Integer awardId, AwardStateVO state) {

        UserAwardRecordEntity userAwardRecordEntity = new UserAwardRecordEntity();
        userAwardRecordEntity.setUserId(userId);
        userAwardRecordEntity.setOrderId(orderId);
        userAwardRecordEntity.setAwardId(awardId);
        userAwardRecordEntity.setAwardState(state);
        return userAwardRecordEntity;

    }
    public static UserCreditAwardEntity buildUserCreditAwardEntity(String userId, BigDecimal creditAmount) {
        UserCreditAwardEntity userCreditAwardEntity = new UserCreditAwardEntity();
        userCreditAwardEntity.setCreditAmount(creditAmount);
        userCreditAwardEntity.setUserId(userId);
        return userCreditAwardEntity;

    }
}
